package com.jh.paymentchannel.repository;

import com.jh.paymentchannel.pojo.JFRegister;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface JFRepository extends JpaRepository<JFRegister, String>, JpaSpecificationExecutor<JFRegister>{
	
	@Query("select jf from  JFRegister jf where jf.userId=:userId and jf.bankCard=:bankCard")
	public JFRegister	getJFRegisterByUseridAndBankCard(@Param("userId") long userId, @Param("bankCard") String bankCard);
	
	@Query("select jf from  JFRegister jf where jf.userId=:userId")
	public JFRegister	getJFRegisterByUserid(@Param("userId") long userId);
	
	//注销用户记录
	@Modifying
	@Query("delete from JFRegister jf where jf.userId=:userid")
	void delJFRegisterByUserid(@Param("userid") long userid);
	
}
